"use strict";
const common_vendor = require("../../../common/vendor.js");
const api_complaint_index = require("../../../api/complaint/index.js");
if (!Array) {
  const _easycom_up_grid_item2 = common_vendor.resolveComponent("up-grid-item");
  const _easycom_up_grid2 = common_vendor.resolveComponent("up-grid");
  const _easycom_up_divider2 = common_vendor.resolveComponent("up-divider");
  const _easycom_up_toast2 = common_vendor.resolveComponent("up-toast");
  (_easycom_up_grid_item2 + _easycom_up_grid2 + _easycom_up_divider2 + _easycom_up_toast2)();
}
const _easycom_up_grid_item = () => "../../../node-modules/uview-plus/components/u-grid-item/u-grid-item.js";
const _easycom_up_grid = () => "../../../node-modules/uview-plus/components/u-grid/u-grid.js";
const _easycom_up_divider = () => "../../../node-modules/uview-plus/components/u-divider/u-divider.js";
const _easycom_up_toast = () => "../../../node-modules/uview-plus/components/u-toast/u-toast.js";
if (!Math) {
  (_easycom_up_grid_item + _easycom_up_grid + _easycom_up_divider + _easycom_up_toast)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "mobComplaintTip",
  setup(__props) {
    const uToastRef = common_vendor.ref(null);
    const statisticsList = common_vendor.ref([
      {
        num: 0,
        title: "本月投诉",
        color: "#038AFE",
        bgColor0: "#FEF9EC",
        bgColor1: "#FFFCF7"
      },
      {
        num: 0,
        title: "本年投诉",
        color: "#61D3C0",
        bgColor0: "#F9FEFD",
        bgColor1: "#F3FFFB"
      },
      {
        num: 0,
        title: "全部",
        color: "#F55300",
        bgColor0: "#F3F9FE",
        bgColor1: "#EEF6FC"
      }
    ]);
    const getStatData = () => {
      common_vendor.index.showLoading({
        title: "加载中",
        mask: true
      });
      api_complaint_index.complaintStatOfPolice().then((res) => {
        common_vendor.index.hideLoading();
        const { data } = res;
        statisticsList.value[0].num = data.monthCount;
        statisticsList.value[1].num = data.yearCount;
        statisticsList.value[2].num = data.sumCount;
      }).catch((err) => {
        common_vendor.index.hideLoading();
        uToastRef.value.show({
          type: "error",
          message: err
        });
      });
    };
    common_vendor.onLoad(() => {
      getStatData();
    });
    return (_ctx, _cache) => {
      return {
        a: common_vendor.f(common_vendor.unref(statisticsList), (item, index, i0) => {
          return {
            a: common_vendor.t(item.num),
            b: common_vendor.t(item.title),
            c: common_vendor.s(`color:${item.color};background: linear-gradient(180deg, ${item.bgColor0} 0%, ${item.bgColor1} 100%);`),
            d: index,
            e: "17a89600-1-" + i0 + ",17a89600-0"
          };
        }),
        b: common_vendor.o(_ctx.click),
        c: common_vendor.p({
          border: false,
          align: "center",
          gap: "18rpx"
        }),
        d: common_vendor.p({
          lineColor: "#BBBBBB"
        }),
        e: common_vendor.sr(uToastRef, "17a89600-3", {
          "k": "uToastRef"
        })
      };
    };
  }
});
wx.createPage(_sfc_main);
